Skip to content

[Repo Assist] eng: fix stale FCS VersionOverride; replace Enumerable.Cast with Seq.cast#1174

Merged
dsyme merged 2 commits intomainfrom
repo-assist/improve-fcs-pin-seq-cast-2026-04-18-7bf530223a32aad3
Apr 20, 2026
Merged

[Repo Assist] eng: fix stale FCS VersionOverride; replace Enumerable.Cast with Seq.cast#1174
dsyme merged 2 commits intomainfrom
repo-assist/improve-fcs-pin-seq-cast-2026-04-18-7bf530223a32aad3

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This is an automated pull request from Repo Assist.

Two small engineering quality improvements — one build-system fix (Task 4) and one code idiom improvement (Task 5).


1. Fix stale FSharp.Compiler.Service VersionOverride (Task 4 — Engineering Investment)

Root cause

A dependabot PR (commit 0c31fe2) bumped FSharp.Compiler.Service to 43.12.201 and added VersionOverride="43.12.201" to FSharp.Formatting.Markdown.fsproj. A subsequent dependabot PR then bumped the central pin in Directory.Packages.props to [43.12.202], but the VersionOverride was not updated. This created a version conflict: the FSharp.Formatting.Common project (a ProjectReference from Markdown) resolved 43.12.202, while the direct PackageReference with the stale VersionOverride tried to pull 43.12.201. The result was a NU1605 ("Detected package downgrade") build warning on every restore.

Fix

Remove the VersionOverride attribute, letting the package use the central pin from Directory.Packages.props (43.12.202) consistently across the solution.

-    <PackageReference Include="FSharp.Compiler.Service" VersionOverride="43.12.201" />
+    <PackageReference Include="FSharp.Compiler.Service" />

Effect: NU1605 warning eliminated; FCS version is now consistent across all projects in the solution.


2. Replace Enumerable.Cast<XAttribute> with Seq.cast<XAttribute> (Task 5 — Coding Improvement)

In MarkdownUtils.fs, the single use of System.Linq.Enumerable.Cast<XAttribute> can be replaced with the idiomatic F# equivalent Seq.cast<XAttribute>. This allows open System.Linq to be removed from the file — a minor clarity improvement that reduces the surface of imported namespaces.

-open System.Linq
 ...
-                enumerable |> Enumerable.Cast<XAttribute> |> Seq.toArray
+                enumerable |> Seq.cast<XAttribute> |> Seq.toArray

Semantics are identical: both cast the untyped IEnumerable to seq<XAttribute>.


Changes

File Change
src/FSharp.Formatting.Markdown/FSharp.Formatting.Markdown.fsproj Remove stale VersionOverride
src/FSharp.Formatting.Markdown/MarkdownUtils.fs Remove open System.Linq; use Seq.cast
RELEASE_NOTES.md Changelog entries

Test Status

⚠️ Infrastructure: dotnet build fails in the sandbox environment with "Creating directory obj/..." errors — this is a pre-existing sandbox limitation, not caused by my changes.

  • The VersionOverride removal was verified: dotnet restore on the Markdown project now completes cleanly with zero NU1605 warnings.
  • Seq.cast<'T> is the documented F# equivalent of Enumerable.Cast<'T> — the semantics are identical.

Generated by 🤖 Repo Assist, see workflow run.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

…cast

- Remove VersionOverride="43.12.201" from FSharp.Formatting.Markdown.fsproj.
  The package now uses the central pin ([43.12.202]) from Directory.Packages.props,
  eliminating the NU1605 (package downgrade) build warning that appeared since
  the central pin was bumped to 43.12.202 in a later dependabot PR.

- Replace Enumerable.Cast<XAttribute> (LINQ) with Seq.cast<XAttribute> (idiomatic F#)
  in MarkdownUtils.fs, allowing the 'open System.Linq' import to be removed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme dsyme marked this pull request as ready for review April 20, 2026 02:38
@dsyme dsyme merged commit 6f78060 into main Apr 20, 2026
4 checks passed
@dsyme dsyme deleted the repo-assist/improve-fcs-pin-seq-cast-2026-04-18-7bf530223a32aad3 branch April 20, 2026 02:39
github-actions Bot added a commit that referenced this pull request Apr 20, 2026
…1 release notes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant